home *** CD-ROM | disk | FTP | other *** search
/ LOGIC 2000 February / LogicCd--feb.2000-mac-cdr.iso / Apple II / Utilities / deimage / DEIMAGE.DOC next >
Encoding:
Text File  |  1994-07-05  |  9.3 KB  |  202 lines  |  [TEXT/pdos]

  1. DEIMAGE 0.1
  2.  
  3. WARNING:  DeImage is buggy and unfinished, though this is
  4. probably as far as I'm going to finish it.  It definitely won't
  5. work for Integer Basic or Text Files.  It seems to work for
  6. AppleSoft and Binary files.  Use it at your own risk.  Have a
  7. nice day.
  8.  
  9. DeImage is a little ProDOS BASIC program I wrote for myself to
  10. get the files out of Apple ][ DOS 3.3 143k image files used with
  11. Kevin Lund's excellent emulator for the Mac, Stop the Madness!
  12. It also appears to work with the images created for some
  13. PC-based Apple ][ emulators which use the same format as STM.
  14.  
  15. It requires:
  16. ProDOS 8 and BASIC.SYSTEM (I assume any version of ProDOS, but I
  17. don't know for sure)
  18. An STM image file of a standard DOS 3.3 disk, located on a
  19. mounted ProDOS volume (i.e. a 3.5" floppy or a hard drive)
  20. Some patience with the interface
  21.  
  22. ModWare:
  23. I'm releasing this program as ModWare.  This means not only are
  24. you free to copy it, give it to friends, feed it to your dog
  25. etc., but you are actively encouraged to improve the software
  26. (easy to do, since it's in BASIC) and re-upload it.  I only ask
  27. that
  28. 1) you increase the version number accordingly,
  29. 2) that you leave these docs in some form, though you are of
  30. course free to modify them,
  31. 3) that you describe your changes in the docs,
  32. 4) you leave my name and the names of any other modifiers before
  33. you in the docs and program lines 990-999.
  34. 5) you test your changes so that they are (somewhat) reliable, and warn about anything that needs to be warned about.
  35. Thanks!
  36.  
  37. Not that this program is really such a big deal anyway, but, hey,
  38. I suppose you have to start somewhere.
  39.  
  40. Since I wrote the program for me, I didn't take extensive pains
  41. to implement a swift interface.  I thought it might be useful to
  42. users of STM, however, so I'm uploading it anyway.
  43.  
  44. Using DeImage:
  45. Actually, it's fairly straightforward.  When you run DeImage, it
  46. will ask you for the name of the file.  If it's in a directory or
  47. on a volume other than the one you're in, include that too.   You
  48. will then be asked for the filetype; pressing return defaults to
  49. BIN ($06).
  50.  
  51. If DeImage can't find the file, it complains and lets you try
  52. again.  User-friendliness abounds!  If you're sure you've got the
  53. name right, make sure you've got the filetype right, too.
  54.  
  55. Otherwise you should be presented with a catalog of your DOS 3.3
  56. disk image.  It's not the fastest program in the world, I know --
  57. it's reading 256-byte chunks at a time.  You are advised to have
  58. your image file on a hard disk or RAM disk for tolerable speed.
  59.  
  60. You'll note on the left-hand side of the screen are numbers
  61. assigned to the files.  If any numbers are skipped, it's because
  62. there was a catalog entry marked as being deleted.  Don't worry
  63. about it.
  64.  
  65. After the catalog is finished, you'll be asked if you want to
  66. extract all the files.  If you say "Y", it's pretty simple -- it
  67. goes through, one by one, and saves each file to whatever
  68. directory you were in when you ran the program.  (If you want to
  69. specify a default save directory, add PRINT D$"PREFIX
  70. /WHEREVER/WHATEVER" at the beginning of the program.)
  71.  
  72. If you answer "N" to the above question, you'll be asked which
  73. files you want.  Enter their numbers, one at a time, pressing
  74. return after each one, and when you're done press return by
  75. itself.  I told you, the interface sucks.
  76.  
  77. Then it should go through and extract all the files you chose.
  78.  As it extracts, you'll notice three numbers pop up -- the first
  79. is the track it's on in the image, the second is the sector, and
  80. the third is the number of sectors (256 bytes) it's loaded.  This
  81. is chiefly for amusement/debugging value (whee).
  82.  
  83. If along the way DeImage encounters a file it can't neatly
  84. convert into a ProDOS filename, it complains at you at asks you
  85. to enter a new name.  What you'll discover unfortunately is that
  86. you'll probably get a RETURN WITHOUT GOSUB error once it's
  87. extracted.  This is because it seems as if ONERR GOTO kills
  88. whatever's on the stack in terms of GOSUB and FOR..NEXT, and I
  89. can't remember what to do about it and don't care that much.
  90. Anyway, if this happens, just be patient and type RUN, and get
  91. the rest of the files you wanted.  Or better still, fix it.  I think all it takes is a well-placed RESUME command.
  92.  
  93. That's it.  Now for the bad parts.
  94.  
  95. Caveats:
  96. DeImage has had LIMITED testing.  It seems to work okay for me,
  97. but I haven't pushed it.  Use it completely at your own risk.  I
  98. don't think the program itself can do any harm, but conceivably a
  99. corrupted extraction could.  Hopefully you won't get any.  You
  100. can also minimize risk by not trying to run questionable files
  101. under ProDOS (see below).
  102.  
  103. If you have two similar DOS 3.3 filenames on your original disk,
  104. one may overwrite the other when saved to ProDOS.  For example,
  105. if you have a file called LUNAR LANDER followed by a file called
  106. LUNAR.LANDER, they both get the same name in ProDOS and so the
  107. second one obliterates the first.  Similarly, if you have two DOS
  108. 3.3 files whose first 15 characters are the same, the same thing
  109. will happen.  Presently, the only workaround is to extract one,
  110. rename it in ProDOS, then extract the other, which is a pain.  I
  111. suggest you modify the program to deal with it somehow.
  112.  
  113. I have only really tested the extraction of A (AppleSoft BASIC)
  114. and B (binary) files.  T (text files) are likely to be iffy --
  115. especially random-access ones.  If DeImage encounters anything
  116. else -- I, S, R, and the "special" A and B -- it will probably
  117. save them as BIN files if it doesn't conk out completely.  Just
  118. be aware, and fix it if you like.
  119.  
  120. Many programs designed to run under DOS 3.3 may not run under
  121. ProDOS, so don't be surprised when they don't.  Particularly be
  122. aware of any programs that do disk calls or that use strange
  123. loaders -- they definitely won't work.  They should work if you
  124. use your favorite utility to convert them back to DOS 3.3,
  125. however.  Stand-alone basic or binary programs may work fine
  126. under ProDOS, however.
  127.  
  128. This program is ONLY intended for use for standard DOS 3.3 disk
  129. images with standard file entries stored in a standard catalog.
  130. There's some error checking for this, but it's not foolproof, so
  131. don't try extracting something which has a sector size of 0 and
  132. whose name is 30 inverse @'s.
  133.  
  134. Um, that's about as much as I can think of, so if there's
  135. anything I seem to have left out, well, ok, so what.
  136.  
  137. Send questions, comments, and whatever to me at
  138. drucker@lclark.edu.  If you find this program actually useful,
  139. I'd like to know...I'd also like some cool images, if you have
  140. any.
  141.  
  142. revision history:
  143. Ivan Drucker 5/24/94 v0.01 -- first release.  Crude but
  144. serviceable, if you count inoperable as serviceable.
  145. 7/4/94 v0.1 -- Fixed some minor bugs, such as no D$=CHR$(4),
  146. clever, huh.  No major changes, those are for you to do.  I don't really plan to ever look at this program again, actually, except when I use it.
  147.  
  148. Also by me for STM hounds:
  149. UnImage Pro (catchy title, huh?), which, as some have requested,
  150. converts an STM image back into a disk, and is therefore useable
  151. with any disk image, not just a standard 3.3.
  152.  
  153. Also:  UnForkIt, a program to split a forked file into two
  154. standard files under ProDOS 8.  Unlike similar programs, it
  155. directly modifies the directory structure rather than copying the
  156. forks to new files.  This brings with it added speed and risk,
  157. without which life would be dull.
  158.  
  159. How DeImage works, for those who care:
  160. Basically, the program makes use of ProDOS' fabulously flexible
  161. BLOAD command to simulate reading sectors under DOS 3.3.
  162.  
  163. It starts by reading the catalog track (Volume Table of Contents,
  164. or VTOC), which is on a standard disk track $11, sectors $0-F.
  165. This is where it reads the catalog and displays it to you.
  166. It loads this into memory at $2000, if I'm not mistaken, and then
  167. works with it in RAM.
  168.  
  169. When you select the files you want, it finds the track and sector
  170. where the file starts, which contains a track/sector list.  This
  171. is a list of track/sector pairs in the order in which they are to
  172. be read off the disk.  I think it loads the T/S list into $1F00. 
  173. If the T/S list is more than one sector, as it is for large
  174. files, the next page is read into $1E00, and so on.
  175.  
  176. DeImage then follows the track/sector list, loading tracks and
  177. sectors into memory in order at $3000.  When it reaches the end
  178. or fills the buffer (ends at $8FFF), it BSAVES the file.  ProDOS
  179. BSAVE is flexible, so it can save multiple chunks into the same
  180. file.
  181.  
  182. Only for those inspecting the program and wondering why the hell
  183. I did things THAT way:
  184. In DOS 3.3, binary files start with four bytes which indicate the
  185. address the file is to load at and the length of it.  AppleSoft
  186. basic files start with two bytes which indicate the length.  Text
  187. files have no header at all.  DeImage compensates for these
  188. offsets -- this is what the variable OFF in the program refers
  189. to.  It was sort of a pain figuring this out, and it is why the
  190. loading/saving is a little convoluted.  I have it load the first
  191. chunk into $3FFC so the the data itself starts at $4000, but then
  192. subsequent chunks have to be loaded at $4000, which means each
  193. page is then filled with each sector rather than being four bytes
  194. short, so the SAVE routine has to be aware of that.  And further
  195. I have to be aware that a file which is, say, 1024 bytes long
  196. actually has 5 data sectors because there is a four-byte "spill"
  197. into the last sector.  Ick.  ProDOS is much nicer, because it
  198. keeps all the file information in the catalog.  If you're
  199. ambitious, try to get it to deal with text or Integer files.
  200.  
  201. Ok, enjoy.
  202.